package com.xiaoshuidi.cloud.module.rooms.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * @Author Feng
 * @date 2023/5/11
 */
@Getter
@AllArgsConstructor
public enum ReservationConfigStatusEnum {
    UN_SETUP("1", "未设置"),
    SETUP("2", "已设置");

    private String code;
    private String value;

    public static String getValue(String code) {
        ReservationConfigStatusEnum first = Arrays.stream(ReservationConfigStatusEnum.values()).filter(s -> code.equals(s.getCode())).findFirst().orElse(null);
        if (first == null) {
            return "";
        }
        return first.getValue();
    }
}
